﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Upeu.Venta.Data.Entities;



namespace Upeu.Venta.Data.Mappings
{
    public class CategoriaMap : EntityTypeConfiguration<Categoria>
    {
        public CategoriaMap()
        {
            //cambiar nombre table
            ToTable("Categoria");

            //pk
            this.HasKey(t => t.Id);

            this.Property(t => t.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            //campos
            Property(t => t.Estado).IsOptional();
            Property(t => t.Descripcion).IsOptional();
            Property(t => t.Nombre).IsRequired();


        }
    }
}

